package com.cc.test;

import com.cc.entity.SalChance;
import com.cc.service.ISalChanceService;
import com.cc.service.impl.SalChanceServiceImpl;
import com.github.pagehelper.PageInfo;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

/**
 * @author 新梦想.陈超
 * @version 2021.2
 * @Description: {TODO}
 * @date 2022/5/9 下午4:47
 */

@RunWith(SpringRunner.class)
@ContextConfiguration("classpath:beans.xml")
public class SalChanceTest2 {
    @Resource
    private ISalChanceService iSalChanceService;

    @Test
    public void testListByPage() {
        PageInfo<SalChance> pageInfo = iSalChanceService.list(2, 3);
        System.out.println("当前页===>" + pageInfo.getPageNum());
        System.out.println("总页数===>" + pageInfo.getPages());
        System.out.println("每页条数===>" + pageInfo.getPageSize());
        System.out.println("表的数据===>" + pageInfo.getList());
    }
    @Test
    public void testSelectChanceRelationUser() {
        SalChance chance = iSalChanceService.selectChanceRelationUser(1);
        //展示机会信息
        System.out.println(chance.toString());
        //展示所有销售人员姓名
        chance.getUserList().forEach(System.out::println);

    }

}
